#ifndef _ENTITY_
#define _ENTITY_

#include <string>
#include "StaticModel.hpp"
#include "Vector3d.hpp"
#include "CollisionModel.hpp"
#include "EntityManager.hpp"


class Game;


class Entity
{
public:
	friend class EntityManager;
	Entity(Game* g, Vector3f pos=Vector3f());
	virtual ~Entity(){}
	
	virtual void Render();
	
	virtual void onTouch(Entity* Toucher) = 0;
	virtual void onInput(InputStruct Input){};
	virtual void onTick(float Time){};
	
	Vector3f getPosition() { return position; };

	void setPosition(Vector3f);
	void setCollisionModel(CollisionModel);

	 ///Filename is relative to resources Path
	void LoadModel(std::string Filename);

	///caleld by Entitymanager upon deletion
	void Delete(){ deleted=true; }
	bool IsDeleted(){ return deleted; }
protected:
	Vector3f position;
	Game* game;
	EntityManager* manager;
	CollisionModel cm;
	StaticModel* m_Model;
	bool deleted; ///< CAUTION: this may only be changed by the EntityManager calling Entity::Delete - do not use it otherwise
};


#endif // _ENTITY_
